﻿using Microsoft.Extensions.DependencyInjection;
using StartsEAS_API.BLL.Interfaces.ICollegeB;
using StartsEAS_API.DAL.CollegeD;
using StartsEAS_API.Model;
using StartsEAS_API.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StartsEAS_API.BLL.CollegeB
{
    public class CollegeBLL : ICollegeBLL
    {
        private readonly StarsEASContext _context;
        public CollegeDAL _collegeDAL;
        public CollegeBLL(IServiceScopeFactory context)
        {
            _context = context.CreateScope().ServiceProvider.GetRequiredService<StarsEASContext>();
            _collegeDAL = new(_context);
        }
        public ResultUtils GetAllCollege()
        {
            return _collegeDAL.GetAllCollege();
        }

        public ResultUtils GetCollege(int CollegeId)
        {
            return _collegeDAL.GetCollege(CollegeId);
        }

        public ResultUtils InsertCollege(string CollegeName)
        {
            return _collegeDAL.InsertCollege(CollegeName);
        }

        public ResultUtils UpdateCollege(College data)
        {
            return _collegeDAL.UpdateCollege(data);
        }
    }
}
